<?php
/**
 * 公告数据获取
 * @文件名称: GetInfoAction.php
 * @author: jawei
 * @Email: gaozhiwei@etcp.cn
 * @Date: 2017-07-07
 * @Copyright: 2017 悦畅科技有限公司. All rights reserved.
 * 注意：本内容仅限于悦畅科技有限公司内部传阅，禁止外泄以及用于其他的商业目的
 */
namespace app\modules\common\actions\announcement;

use app\base\BaseService;
use app\modules\common\services\common\AnnouncementService;
use yii\base\Action;
use yii;

class GetInfoAction extends Action
{
    public function run() {
        $id = (int)Yii::$app->request->post('id', 0);
        if($id) {
            $ret = AnnouncementService::getInfoById($id);
            if(BaseService::checkRetIsOk($ret)) {
                return $ret;
            }
            return BaseService::returnErrData([], 50007027, "请求数据不存在");
        }
        return BaseService::returnErrData([], 50007029, "请求参数异常");
    }
}